package com.livew.framework.base.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.livew.framework.base.dao.SysUserMapper;
import com.livew.framework.base.model.SysUser;
import com.livew.framework.base.service.UserService;

@Service
public class UserServiceImpl implements UserService{
	
	@Resource
	private SysUserMapper userMapper;

	@Override
	public SysUser getLoginNameAndPassword(String username,String password) {
		SysUser user= new SysUser();
		user.setUsername(username);
		user.setPhone(username);
		user.setPassword(password);
		return	userMapper.selectUserByLoginNameAndPassword(user);
	}

	@Override
	public SysUser getAPILoginNameAndPassword(String username, String password, String type) {
		SysUser user= new SysUser();
		user.setUsername(username);
		user.setPhone(username);
		user.setPassword(password); 
		user.setType(type);
		return	userMapper.selectAPILoginNameAndPassword(user);
	}
}
